package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();

        String name = main.getName();//获取线程名字
        System.out.println(name);

        long id = main.getId();//获取唯一标识符
        System.out.println(id);

        int priority = main.getPriority();//获取优先级
        System.out.println(priority);

        boolean alive = main.isAlive();//是否活着
        System.out.println(alive);

        boolean daemon = main.isDaemon();//是否为守护线程
        System.out.println(daemon);

        boolean interrupted = main.isInterrupted();//是否被中断
        System.out.println(interrupted);

    }
}
